package set.demo;

import java.util.HashSet;

public class SetDemo {
	//结论：会把set集合中的元素一一放入想要添加进来的元素的equale方法去比较
	public static void main(String[] args) {
		HashSet<Person> persons=new HashSet<Person>();
		persons.add(new Person(0, "zhang0"));
		System.out.println("-------------------------------------------");
		persons.add(new Person(1, "zhang1"));
		System.out.println("-------------------------------------------");
		persons.add(new Person(2, "zhang2"));
		System.out.println("-------------------------------------------");
		persons.add(new Person(3, "zhang3"));
		System.out.println("-------------------------------------------");
		persons.add(new Person(2, "zhang4"));
		System.out.println("-------------------------------------------");
	}
}
